/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mldn.demo;

/**
 *
 * @author Administrator
 */
public class SingleDemo4 {
    public static void main(String[] args) {
        Singleton s1 = null;
        s1 = Singleton.getInstance();
        s1.print();
    }
}

class Singleton{
    private static Singleton instance = new Singleton();
    private Singleton(){}
    public void print(){
        System.out.println("hello world!!");
    }
    public static Singleton getInstance(){
        return instance;
    }
}